package com.ruoyi.ziran.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ziran.mapper.ZrVideoMapper;
import com.ruoyi.ziran.domain.ZrVideo;
import com.ruoyi.ziran.service.IZrVideoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 自然灾害视频Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class ZrVideoServiceImpl implements IZrVideoService 
{
    @Autowired
    private ZrVideoMapper zrVideoMapper;

    /**
     * 查询自然灾害视频
     * 
     * @param id 自然灾害视频主键
     * @return 自然灾害视频
     */
    @Override
    public ZrVideo selectZrVideoById(Long id)
    {
        return zrVideoMapper.selectZrVideoById(id);
    }

    /**
     * 查询自然灾害视频列表
     * 
     * @param zrVideo 自然灾害视频
     * @return 自然灾害视频
     */
    @Override
    public List<ZrVideo> selectZrVideoList(ZrVideo zrVideo)
    {
        return zrVideoMapper.selectZrVideoList(zrVideo);
    }

    /**
     * 新增自然灾害视频
     * 
     * @param zrVideo 自然灾害视频
     * @return 结果
     */
    @Override
    public int insertZrVideo(ZrVideo zrVideo)
    {
        zrVideo.setCreateTime(DateUtils.getNowDate());
        return zrVideoMapper.insertZrVideo(zrVideo);
    }

    /**
     * 修改自然灾害视频
     * 
     * @param zrVideo 自然灾害视频
     * @return 结果
     */
    @Override
    public int updateZrVideo(ZrVideo zrVideo)
    {
        zrVideo.setUpdateTime(DateUtils.getNowDate());
        return zrVideoMapper.updateZrVideo(zrVideo);
    }

    /**
     * 批量删除自然灾害视频
     * 
     * @param ids 需要删除的自然灾害视频主键
     * @return 结果
     */
    @Override
    public int deleteZrVideoByIds(String ids)
    {
        return zrVideoMapper.deleteZrVideoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除自然灾害视频信息
     * 
     * @param id 自然灾害视频主键
     * @return 结果
     */
    @Override
    public int deleteZrVideoById(Long id)
    {
        return zrVideoMapper.deleteZrVideoById(id);
    }
}
